package com.jadcon.bedbreakfast.domain;

public enum PhoneType {
	
	HOME (1),
	OFFICE (2), 
	CELL (3), 
	FAX (4);
	
	private int id;
	
	private PhoneType(int id) {
		this.id = id;
	}

	public int getId() {
		return id;
	}
	
	public static PhoneType valueOf(int id) {
		for (PhoneType phoneType : PhoneType.values()) {
			if (phoneType.getId() == id) {
				return phoneType;
			}
		} 
		throw new IllegalArgumentException("Value " + id + " is not a valid phone type id");
	}
}
